/**
 *  After solving nice problems about bishops and rooks, Petya decided that he would like to learn to play chess. He started to learn the rules and found out that the most important piece in the game is the king.

 *  The king can move to any adjacent cell (there are up to eight such cells). Thus, two kings are in the attacking position, if they are located on the adjacent cells.

 * Of course, the first thing Petya wants to know is the number of ways one can position k kings on a chessboard of size n × n so that no two of them are in the attacking position. Help him!
 */

#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
typedef long long ll;
ll dp[11][(1<<10)+10][105];
int s[(1<<10)+10], scnt;
int bitcnt[(1<<10)+10];
int N, K;

bool check_state(int x) {
    int bit[11], bcnt = 0;
    if(x == 0) bit[bcnt++] = 0;
    while(x) {
        bit[bcnt++] = x&1;
        x >>= 1;
    }
    for(int i = 0; i < bcnt; ++i) {
        int t = 0;
        if(i - 1 >= 0) t += bit[i-1];
        t += bit[i];
        if(i + 1 < bcnt) t += bit[i+1];
        if(bit[i] && t > 1) return false;
    }
    return true;
}

void init() {
    scnt = 0;
    for(int i = 0; i < (1<<N); ++i) {
        if(check_state(i)) {
            s[scnt++] = i;
        }
        bitcnt[i] = __builtin_popcount(i);
    }
}


int main() {
    while(scanf("%d %d", &N, &K) != EOF) {
        init();
        dp[0][0][0] = 1;
        for(int i = 1; i <= N; ++i) {
            for(int j = 0; j < scnt; ++j) {
                for(int k = 0; k <= K; ++k) {
                    dp[i][s[j]][k] = 0;
                    if(bitcnt[s[j]] > k) continue;
                    for(int l = 0; l < scnt; ++l) {
                        int t1 = s[j] & s[l];
                        int t2 = s[j] | s[l];
                        if(t1 == 0 && check_state(t2)) {
                            dp[i][s[j]][k] += dp[i-1][s[l]][k-bitcnt[s[j]]];
                        }
                    }
                }
            }
        }
        ll ans = 0;
        for(int i = 0; i < scnt; ++i) {
            ans += dp[N][s[i]][K];
        }
        cout << ans << endl;
    }
    return 0;
}
